#ifndef __TERRAINSURFACECMD_H__
#define __TERRAINSURFACECMD_H__

#include <stl/map.h>
#include "command.h"
#include "terrain/terrainblock.h"

struct STerrainSurfaceInfo{
    CTerrainBlock* m_pTerrainBlock;
    STerrainBlockTextureLayerInfo m_sOriginLayerInfo;
    STerrainBlockTextureLayerInfo m_sNewLayerInfo;
};


class CTerrainSurfaceCmd: public CCommand{
public:
    CTerrainSurfaceCmd( list< STerrainSurfaceInfo > *pTerrainSurfaceEditInfoList );
    virtual ~CTerrainSurfaceCmd();
    virtual void Init();
	virtual void Final();
    virtual bool32 Redo();
    virtual bool32 Undo();

private:
    list< STerrainSurfaceInfo > m_vTerrainSurfaceEditInfoList;
};

class CTerrainBlockUVScaleCmd: public CCommand{
public:
    CTerrainBlockUVScaleCmd( CTerrainBlock* pTerrainBlock, int32 nLayerIndex, int32 nUVScale );
    virtual ~CTerrainBlockUVScaleCmd();
    virtual void Init();
	virtual void Final();
    virtual bool32 Redo();
    virtual bool32 Undo();

private:
    CTerrainBlock* m_pTerrainBlock;
    int32 m_nLayerIndex;
    int32 m_nOriginUVScale;
    int32 m_nNewUVScale;
};

class CTerrainBlockLayerDeleteCmd: public CCommand{
public:
    CTerrainBlockLayerDeleteCmd( CTerrainBlock* pTerrainBlock, int32 nLayerIndex );
    virtual ~CTerrainBlockLayerDeleteCmd();
    virtual void Init();
	virtual void Final();
    virtual bool32 Redo();
    virtual bool32 Undo();

private:
    CTerrainBlock* m_pTerrainBlock;
    int32 m_nLayerIndex;

    CTexture* m_pLayerTextureList[4];
    int32 m_nLayerUVScaleList[4];
    color32 m_vLayerAlpha[ SUBBLOCKGRIDCOUNT * SUBBLOCKGRIDCOUNT ];

};

#endif

